<#assign pageName="新增菜单">
<@override name="page-content">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>${pageName}</legend>
    </fieldset>
    <form class="layui-form padding-10" lay-filter="formMenuAdd">
          <@ctrl.Hidden path="menus.guid" value="${guid}"/>
          <@ctrl.SingleSelect path="menus.type" options={'0':'权限菜单','1':'默认菜单'} labelText="菜单类型" required="required"/>
          <@ctrl.TreeSelect path="menus.upperId" dataList=parentMenus![] fieldText="menuCaption" fieldValue="menuId" 
              labelText="上级菜单" fieldParentID="upperId" parentidValue="-1" required="required">
              <option value="-1">—无上级菜单—</option>
          </@ctrl.TreeSelect>
          <@ctrl.Textbox path="menus.menuCaption" labelText="菜单名称" required="required"/>
          <@ctrl.Textbox path="menus.httpAddress" labelText="访问地址" required="required"/>
          <@ctrl.Textbox path="menus.orderNo" labelText="菜单排序" required="required"/>
          <@ctrl.Textbox path="menus.icon" labelText="菜单图标" value="fa fa-tag">
              <a href="https://fontawesome.dashgame.com" target="_blank">查看图标</a>
          </@ctrl.Textbox>
          <@ctrl.FormAction backURL="../management?gid=${guid}"/>
    </form>
</@override>
<@override name="page-scripts">
<script>
    $(function(){
        layui.use(['form','layer', 'jquery'], function(){
            var form = layui.form;
            var layer=layui.layer;
            $=layui.jquery;
            //监听提交
            form.on('submit(submit)', function(data){
                submitData(data.field, '${contextPath}/admin/menus/add', function(){location.href="${contextPath}/admin/menus/management?gid=${guid}";});
                return false;
            });
        })
    })
</script>
</@override>
<@extends name="/layout/basepage.html"/> 